PATH 
Mac OS 8 and 9 Developer Documentation > Text and Other International Services > Apple Type Services for Unicode Imaging (ATSUI) > Apple Type Services for Unicode Imaging Reference

     

ATSUCreateMemorySetting

Creates a memory setting.

OSStatus ATSUCreateMemorySetting (
                     ATSUHeapSpec iHeapSpec,
                     ATSUMemoryCallbacks *iMemoryCallbacks,
                     ATSUMemorySetting *oMemorySetting);
iHeapSpec
A value of type ATSUHeapSpec. Pass a value that indicates you want ATSUI or your own application to control memory allocation in ATSUI. See Heap Specification Constants for a description of possible values. If you pass the kATSUUseSpecificHeap constant, you must pass a pointer to a union that contains the correctly-prepared heap in the heapToUse field in the iMemoryCallbacks parameter. If you pass the kATSUUseCallbacks constant, you must pass a pointer to a ATSUMemoryCallbacks union that contains pointers to your application-defined functions in the iMemoryCallbacks parameter. If you pass the kATSUUseCurrentHeap or kATSUUseAppHeap constant, you should pass a NULL pointer in the iMemoryCallbacks parameter. You must pass a valid value for this parameter.

iMemoryCallbacks
A pointer to a union of type ATSUMemoryCallbacks. Pass a pointer to a union that contains either pointers to your application-defined memory allocation functions or the heap that you want ATSUI to use when allocating memory.

oMemorySetting
A pointer to a reference of type ATSUMemorySetting. On return, the new memory allocation setting. To make this setting current, you must pass it to the function ATSUSetCurrentMemorySetting. You cannot pass NULL for this parameter.

function result
A result code. See Result Codes.
DISCUSSION
The ATSUCreateMemorySetting function enables you to specify whether you wish to perform memory allocations yourself or have ATSUI do so. If you want to control memory allocation in ATSUI, pass kATSUUseCallbacks in the iHeapSpec parameter and a pointer to a ATSUMemoryCallbacks union that contains pointers to your callback functions in the iMemoryCallbacks parameter.

After creating a memory setting, you must pass it to the function ATSUSetCurrentMemorySetting to ensure that it will be used in subsequent Memory Manager calls.

You might want to create different memory settings for different memory allocation operations. For example, you might create two different settings designating different heaps to use for allocating the memory associated with style and text layout object creation. Before creating a style or text layout object, you would then make the appropriate setting current by calling ATSUSetCurrentMemorySetting.

VERSION NOTES
Available beginning with ATSUI 1.1.


© 2000 Apple Computer, Inc. – (Last Updated 25 Jan 00)